#pragma once


class CFadingText
{
public:
	CFadingText(): m_alpha(0) {}

	void SetText(const char* text)
	{
		assert(text);
		m_alpha = 1.0f;
		m_text = text;
	}

	void Render()
	{
		if (m_alpha > 0)
		{
			uint color = 0x00ffffff | static_cast<uint>(round(255 * m_alpha)) << 24;
			gEnv->pRender->GetFont()->RenderText(m_text.c_str(), 100, 100, color);
			m_alpha -= gEnv->pTimer->GetFrameTime()/1;
		}
	}

private:
	string	m_text;
	float		m_alpha;
};